import 'package:flutter/material.dart';

/// 首页界面的provider
class MainProvider extends ChangeNotifier {
  /// pageInex: PageView通知BottomNavBar切换
  int _currentIndex = 0;

  int get currentIndex => _currentIndex;

  switchTabbar(int index) {
    _currentIndex = index;
    notifyListeners();
  }

  /// TabBar切换PageView
  PageController pageController = PageController(initialPage: 0);

  void scroll2Page(int index) {
    pageController.jumpToPage(index);
    notifyListeners();
  }
}
